﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Senparc.Weixin.Context;
using Senparc.Weixin.MP.Entities;

namespace Model.Weixin
{
    public class FKMessageContext : MessageContext<IRequestMessageBase,IResponseMessageBase>
    {
        public FKMessageContext()
        {
            base.RequestMessages = new MessageContainer<IRequestMessageBase>();
            base.ResponseMessages = new MessageContainer<IResponseMessageBase>();
            base.LastActiveTime = DateTime.Now;
            base.MessageContextRemoved += FKMessageContext_MessageContextRemoved;
        }
        void FKMessageContext_MessageContextRemoved(object sender, Senparc.Weixin.Context.WeixinContextRemovedEventArgs<IRequestMessageBase,IResponseMessageBase> e)
        {

            var messageContext = e.MessageContext as FKMessageContext;
            if (messageContext == null)
            {
                return;//如果是正常的调用，messageContext不会为null
            }
        }
    }
}